<template>
  <webview ref="webviewRef" :src="webUrl" style="width:100%;height:100%" allowpopups></webview>
</template>

<script setup>
import { ref, onMounted } from 'vue'
import { ipcApiRoute } from "@/api/index.js";
import { ipc } from '@/utils/ipcRenderer'

const webviewRef = ref()
const webUrl = ref("https://www.donet5.com/UserCenter")
const url = "https://www.donet5.com"
onMounted(() => {
  const cookies = [
    {
      url: url,
      name: 'ASP.NET_SessionId',
      value: "gqphbcidfn1eyr5csynu2fcp"
    }, {
      url: url,
      name: 'CookeUniqueKey',
      value: "86f62802-364e-41f0-8477-ef5c34785986"
    }
  ]
  ipc.invoke(ipcApiRoute.cookie.setCookies, cookies).then(res => {
    console.log("setCookie", res)
  })

})

</script>